<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>客户管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		disableExitMenu();
	});
</script>
</head>
<body>
	<div class="icon-buttons">
		<c:choose>
			<c:when test="${param.target=='cash/member'}">
				<input type="button" data-inline="true" data-icon="back"
					onclick="return directOpenURL('${ctx}/cash/member')"
					data-iconpos="notext" value="返回" />
			</c:when>
			<c:otherwise>
				<a href="#" id="dialog-upload-cancel" data-icon="back"
					data-iconpos="notext" data-role="button" data-inline="true"
					data-rel="back" data-theme="a">返回</a>
			</c:otherwise>
		</c:choose>
	</div>
	<br />
	<h2 style="text-align: center;">消费明细页面</h2>
	<br />
	<tags:message content="${message}" />
	<div class="form-input">
		<c:if test="${consumeInfo.storeConsumeDebt!=null}">
			<div data-role="collapsible" data-collapsed="false">
				<h4>还欠款</h4>
				<div class="middleCls">

					<table id="newCardTable" data-role="table"
						class="ui-responsive table-stroke">
						<thead>
							<tr>
								<th>欠款消费编号</th>
								<th>还款金额</th>
								<th>欠款日期</th>
								<th>还款日期</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>
									${consumeInfo.storeConsumeDebt.debtConsume.consume_Number}</td>
								<td>${consumeInfo.storeConsumeDebt.debtMoney}</td>
								<td>
									${fns:formatDate(consumeInfo.storeConsumeDebt.debtConsume.consume_Time,'yyyy-MM-dd
									HH:mm:ss')}</td>
								<td>
									${fns:formatDate(consumeInfo.storeConsumeDebt.refundConsume.consume_Time,'yyyy-MM-dd
									HH:mm:ss')}</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</c:if>
		<c:if test="${not empty consumeInfo.storeConsumeNewCardList}">
			<div data-role="collapsible" data-collapsed="false">
				<h4>新开卡(${fn:length(consumeInfo.storeConsumeNewCardList)})</h4>
				<div class="middleCls">
					<c:if test="${not empty consumeInfo.storeConsumeNewCardList}">
						<table id="newCardTable" data-role="table"
							class="ui-responsive table-stroke">
							<thead>
								<tr>
									<th>卡名</th>
									<th>卡号</th>
									<th>零售价</th>
									<th>店面优惠价</th>
									<th>服务专员</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${consumeInfo.storeConsumeNewCardList}"
									var="newCard">
									<tr>
										<td>${fns:getCard(0, newCard.card_type,
											newCard.card_id).name}</td>
										<td>${fns:getCard(0, newCard.card_type,
											newCard.card_id).number}</td>
										<td>${fns:getCard(0, newCard.card_type,
											newCard.card_id).retail_price}</td>
										<td>${fns:getCard(0, newCard.card_type,
											newCard.card_id).real_price}</td>
										<td>${newCard.employee.name}</td>
									</tr>
								</c:forEach>

							</tbody>
						</table>
					</c:if>
				</div>
			</div>
		</c:if>
		<c:if test="${not empty consumeInfo.storeConsumeRechargeCardList}">
			<div data-role="collapsible" data-collapsed="false">
				<h4>卡充值(${fn:length(consumeInfo.storeConsumeRechargeCardList)})</h4>
				<div class="middleCls">
					<c:if test="${not empty consumeInfo.storeConsumeRechargeCardList}">
						<table id="rechargeCardTable" data-role="table"
							class="ui-responsive table-stroke">
							<thead>
								<tr>
									<th>卡名</th>
									<th>卡号</th>
									<th>充值内容</th>
									<th>零售价</th>
									<th>店面优惠价</th>
									<th>服务专员</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${consumeInfo.storeConsumeRechargeCardList}"
									var="rechargeCard">
									<tr>
										<td>${fns:getCard(0, rechargeCard.card_type,
											rechargeCard.card_id).name}</td>
										<td>${fns:getCard(0, rechargeCard.card_type,
											rechargeCard.card_id).number}</td>
										<td><c:if test="${not empty rechargeCard.recharge_times}">充值${rechargeCard.recharge_times}次</c:if>
											<c:if test="${not empty rechargeCard.recharge_duration}">充值${rechargeCard.recharge_duration}月</c:if>
											<c:if test="${not empty rechargeCard.recharge_money}">充值${rechargeCard.recharge_money}元</c:if>
										</td>
										<td>${rechargeCard.retail_price}</td>
										<td>${rechargeCard.real_cost}</td>
										<td>${rechargeCard.employee.name}</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</c:if>
				</div>
			</div>
		</c:if>
		<c:if test="${not empty consumeInfo.storeConsumeBuyProductList}">
			<div data-role="collapsible" data-collapsed="false">
				<h4>购买产品(${fn:length(consumeInfo.storeConsumeBuyProductList)})</h4>
				<div class="middleCls">
					<c:if test="${not empty consumeInfo.storeConsumeBuyProductList}">
						<table id="buyProductCardTable" data-role="table"
							class="ui-responsive table-stroke">
							<thead>
								<tr>
									<th>产品名</th>
									<th>数量</th>
									<th>零售价</th>
									<th>店面优惠价</th>
									<th>合计</th>
									<th>服务专员</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${consumeInfo.storeConsumeBuyProductList}"
									var="buyProductCard">
									<tr>
										<td><c:if
												test="${buyProductCard.storeProduct.product_type == 0 }">
											${buyProductCard.storeProduct.product.name}
										</c:if> <c:if
												test="${buyProductCard.storeProduct.product_type == 1 }">
											${buyProductCard.storeProduct.storeSelfProduct.name}
										</c:if></td>
										<td>${buyProductCard.amount}</td>
										<td>${buyProductCard.retail_price}</td>
										<td>${buyProductCard.real_cost}</td>
										<td>${buyProductCard.real_cost_total}</td>
										<td>${buyProductCard.employee.name}</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</c:if>
				</div>
			</div>
		</c:if>
		<c:if test="${not empty consumeInfo.storeConsumeDoCareList}">
			<div data-role="collapsible" data-collapsed="false">
				<h4>手工护理(${fn:length(consumeInfo.storeConsumeDoCareList)})</h4>
				<div class="middleCls">
					<c:if test="${not empty consumeInfo.storeConsumeDoCareList}">
						<table id="doCareCardTable" data-role="table"
							class="ui-responsive table-stroke">
							<thead>
								<tr>
									<th>护理项目</th>
									<th>卡名</th>
									<th>卡号</th>
									<th>支付现金</th>
									<th>服务专员</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${consumeInfo.storeConsumeDoCareList}"
									var="doCareCard">
									<tr>
										<td><c:if test="${doCareCard.storeCare.care_type == 0 }">
											${doCareCard.storeCare.care.name}
										</c:if> <c:if test="${doCareCard.storeCare.care_type == 1 }">
											${doCareCard.storeCare.storeSelfCare.name}
										</c:if></td>
										<td><c:if test="${not empty doCareCard.card_id}">
											${fns:getCard(2, doCareCard.payment_type, doCareCard.card_id).name}
										</c:if></td>
										<td><c:if test="${not empty doCareCard.card_id}">
											${fns:getCard(2, doCareCard.payment_type, doCareCard.card_id).number}
										</c:if></td>
										<td><c:if test="${not empty doCareCard.card_id}">
											${doCareCard.real_cost}
										</c:if> <c:if test="${empty doCareCard.card_id}">
												<c:if test="${empty doCareCard.real_cost}">
												时段卡耗卡
											</c:if>
												<c:if test="${not empty doCareCard.real_cost}">
												${doCareCard.real_cost}
											</c:if>
											</c:if></td>
										<td>${doCareCard.employee.name}</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</c:if>
				</div>
			</div>
		</c:if>
	</div>
</body>
</html>
